package com.kye.express.business.notice.notice_detail.viewbinder;

import android.databinding.DataBindingUtil;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.kye.express.R;
import com.kye.express.databinding.LayoutNoticeDetailCommentReplyItemBinding;
import com.kye.model.bean.notice.NoticeCommentModel;

import me.drakeet.multitype.ItemViewBinder;

/**
 * @author : Joe
 * @version : 1.0
 * @editor : Joe
 * @created : 28/12/2017
 * @updated : 28/12/2017
 * @description : <Description>
 * @update_reason : <UpdateReason>
 */

public class NoticeCommentReplyItemViewBinder extends ItemViewBinder<NoticeCommentModel, NoticeCommentReplyItemViewBinder.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View view = inflater.inflate(R.layout.layout_notice_detail_comment_reply_item, parent, false);
        return new ViewHolder(view);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull NoticeCommentModel item) {
        holder.bindData(item);
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        protected LayoutNoticeDetailCommentReplyItemBinding databinding;

        public ViewHolder(View itemView) {
            super(itemView);
            databinding = DataBindingUtil.bind(itemView);
        }

        public void bindData(NoticeCommentModel item) {
            databinding.setData(item);
        }
    }
}
